﻿using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x02000003 RID: 3
[AddComponentMenu("Dynamic Bone/Dynamic Bone")]
public class DynamicBone : MonoBehaviour
{
	// Token: 0x06000005 RID: 5 RVA: 0x00002294 File Offset: 0x00000494
	public virtual void Start()
	{
		this.SetupParticles();
	}

	// Token: 0x06000006 RID: 6 RVA: 0x0000229C File Offset: 0x0000049C
	public virtual void Update()
	{
		if (this.m_Weight > 0f && (!this.m_DistantDisable || !this.m_DistantDisabled))
		{
			this.InitTransforms();
		}
	}

	// Token: 0x06000007 RID: 7 RVA: 0x000022CC File Offset: 0x000004CC
	public virtual void LateUpdate()
	{
		if (this.m_DistantDisable)
		{
			this.CheckDistance();
		}
		if (this.m_Weight > 0f && (!this.m_DistantDisable || !this.m_DistantDisabled))
		{
			this.UpdateDynamicBones(Time.deltaTime);
		}
	}

	// Token: 0x06000008 RID: 8 RVA: 0x0000231C File Offset: 0x0000051C
	public virtual void CheckDistance()
	{
		Transform transform = this.m_ReferenceObject;
		if (transform == null && Camera.main != null)
		{
			transform = Camera.main.transform;
		}
		if (transform != null)
		{
			float sqrMagnitude = (transform.position - base.transform.position).sqrMagnitude;
			bool flag = sqrMagnitude > this.m_DistanceToObject * this.m_DistanceToObject;
			if (flag != this.m_DistantDisabled)
			{
				if (!flag)
				{
					this.ResetParticlesPosition();
				}
				this.m_DistantDisabled = flag;
			}
		}
	}

	// Token: 0x06000009 RID: 9 RVA: 0x000023B4 File Offset: 0x000005B4
	public virtual void OnEnable()
	{
		this.ResetParticlesPosition();
	}

	// Token: 0x0600000A RID: 10 RVA: 0x000023BC File Offset: 0x000005BC
	public virtual void OnDisable()
	{
		this.InitTransforms();
	}

	// Token: 0x0600000B RID: 11 RVA: 0x000023C4 File Offset: 0x000005C4
	public virtual void OnValidate()
	{
		this.m_UpdateRate = Mathf.Max(this.m_UpdateRate, 0f);
		this.m_Damping = Mathf.Clamp01(this.m_Damping);
		this.m_Elasticity = Mathf.Clamp01(this.m_Elasticity);
		this.m_Stiffness = Mathf.Clamp01(this.m_Stiffness);
		this.m_Inert = Mathf.Clamp01(this.m_Inert);
		this.m_Radius = Mathf.Max(this.m_Radius, 0f);
		if (Application.isEditor && Application.isPlaying)
		{
			this.InitTransforms();
			this.SetupParticles();
		}
	}

	// Token: 0x0600000C RID: 12 RVA: 0x00002464 File Offset: 0x00000664
	public virtual void OnDrawGizmosSelected()
	{
		if (!base.enabled || this.m_Root == null)
		{
			return;
		}
		if (Application.isEditor && !Application.isPlaying && base.transform.hasChanged)
		{
			this.InitTransforms();
			this.SetupParticles();
		}
		Gizmos.color = Color.white;
		for (int i = 0; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			if (particle.m_ParentIndex >= 0)
			{
				global::DynamicBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
				Gizmos.DrawLine(particle.m_Position, particle2.m_Position);
			}
			if (particle.m_Radius > 0f)
			{
				Gizmos.DrawWireSphere(particle.m_Position, particle.m_Radius * this.m_ObjectScale);
			}
		}
	}

	// Token: 0x0600000D RID: 13 RVA: 0x00002548 File Offset: 0x00000748
	public virtual void SetWeight(float w)
	{
		if (this.m_Weight != w)
		{
			if (w == 0f)
			{
				this.InitTransforms();
			}
			else if (this.m_Weight == 0f)
			{
				this.ResetParticlesPosition();
			}
			this.m_Weight = w;
		}
	}

	// Token: 0x0600000E RID: 14 RVA: 0x00002594 File Offset: 0x00000794
	public virtual float GetWeight()
	{
		return this.m_Weight;
	}

	// Token: 0x0600000F RID: 15 RVA: 0x0000259C File Offset: 0x0000079C
	public virtual void UpdateDynamicBones(float t)
	{
		if (this.m_Root == null)
		{
			return;
		}
		this.m_ObjectScale = Mathf.Abs(base.transform.lossyScale.x);
		this.m_ObjectMove = base.transform.position - this.m_ObjectPrevPosition;
		this.m_ObjectPrevPosition = base.transform.position;
		int num = 1;
		if (this.m_UpdateRate > 0f)
		{
			float num2 = 1f / this.m_UpdateRate;
			this.m_Time += t;
			num = 0;
			while (this.m_Time >= num2)
			{
				this.m_Time -= num2;
				if (++num >= 3)
				{
					this.m_Time = 0f;
					break;
				}
			}
		}
		if (num > 0)
		{
			for (int i = 0; i < num; i++)
			{
				this.UpdateParticles1();
				this.UpdateParticles2();
				this.m_ObjectMove = Vector3.zero;
			}
		}
		else
		{
			this.SkipUpdateParticles();
		}
		this.ApplyParticlesToTransforms();
	}

	// Token: 0x06000010 RID: 16 RVA: 0x000026B0 File Offset: 0x000008B0
	public virtual void SetupParticles()
	{
		this.m_Particles.Clear();
		if (this.m_Root == null)
		{
			return;
		}
		this.m_LocalGravity = this.m_Root.InverseTransformDirection(this.m_Gravity);
		this.m_ObjectScale = base.transform.lossyScale.x;
		this.m_ObjectPrevPosition = base.transform.position;
		this.m_ObjectMove = Vector3.zero;
		this.m_BoneTotalLength = 0f;
		this.AppendParticles(this.m_Root, -1, 0f);
		for (int i = 0; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			particle.m_Damping = this.m_Damping;
			particle.m_Elasticity = this.m_Elasticity;
			particle.m_Stiffness = this.m_Stiffness;
			particle.m_Inert = this.m_Inert;
			particle.m_Radius = this.m_Radius;
			if (this.m_BoneTotalLength > 0f)
			{
				float time = particle.m_BoneLength / this.m_BoneTotalLength;
				if (this.m_DampingDistrib != null && this.m_DampingDistrib.keys.Length > 0)
				{
					particle.m_Damping *= this.m_DampingDistrib.Evaluate(time);
				}
				if (this.m_ElasticityDistrib != null && this.m_ElasticityDistrib.keys.Length > 0)
				{
					particle.m_Elasticity *= this.m_ElasticityDistrib.Evaluate(time);
				}
				if (this.m_StiffnessDistrib != null && this.m_StiffnessDistrib.keys.Length > 0)
				{
					particle.m_Stiffness *= this.m_StiffnessDistrib.Evaluate(time);
				}
				if (this.m_InertDistrib != null && this.m_InertDistrib.keys.Length > 0)
				{
					particle.m_Inert *= this.m_InertDistrib.Evaluate(time);
				}
				if (this.m_RadiusDistrib != null && this.m_RadiusDistrib.keys.Length > 0)
				{
					particle.m_Radius *= this.m_RadiusDistrib.Evaluate(time);
				}
			}
			particle.m_Damping = Mathf.Clamp01(particle.m_Damping);
			particle.m_Elasticity = Mathf.Clamp01(particle.m_Elasticity);
			particle.m_Stiffness = Mathf.Clamp01(particle.m_Stiffness);
			particle.m_Inert = Mathf.Clamp01(particle.m_Inert);
			particle.m_Radius = Mathf.Max(particle.m_Radius, 0f);
		}
	}

	// Token: 0x06000011 RID: 17 RVA: 0x00002934 File Offset: 0x00000B34
	public virtual void AppendParticles(Transform b, int parentIndex, float boneLength)
	{
		global::DynamicBone.Particle particle = new global::DynamicBone.Particle();
		particle.m_Transform = b;
		particle.m_ParentIndex = parentIndex;
		if (b != null)
		{
			particle.m_Position = (particle.m_PrevPosition = b.position);
			particle.m_InitLocalPosition = b.localPosition;
			particle.m_InitLocalRotation = b.localRotation;
		}
		else
		{
			Transform transform = this.m_Particles[parentIndex].m_Transform;
			if (this.m_EndLength > 0f)
			{
				Transform parent = transform.parent;
				if (parent != null)
				{
					particle.m_EndOffset = transform.InverseTransformPoint(transform.position * 2f - parent.position) * this.m_EndLength;
				}
				else
				{
					particle.m_EndOffset = new Vector3(this.m_EndLength, 0f, 0f);
				}
			}
			else
			{
				particle.m_EndOffset = transform.InverseTransformPoint(base.transform.TransformDirection(this.m_EndOffset) + transform.position);
			}
			particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset));
		}
		if (parentIndex >= 0)
		{
			boneLength += (this.m_Particles[parentIndex].m_Transform.position - particle.m_Position).magnitude;
			particle.m_BoneLength = boneLength;
			this.m_BoneTotalLength = Mathf.Max(this.m_BoneTotalLength, boneLength);
		}
		int count = this.m_Particles.Count;
		this.m_Particles.Add(particle);
		bool flag = false;
		int index = 0;
		if (b != null)
		{
			for (int i = 0; i < b.childCount; i++)
			{
				bool flag2 = false;
				if (this.m_Exclusions != null)
				{
					int j = 0;
					while (j < this.m_Exclusions.Count)
					{
						Transform x = this.m_Exclusions[j];
						if (x == b.GetChild(i))
						{
							flag2 = true;
							break;
						}
						i++;
					}
				}
				if (!flag2)
				{
					for (int k = 0; k < this.m_notRolls.Count; k++)
					{
						Transform x2 = this.m_notRolls[k];
						if (x2 == b.GetChild(i))
						{
							flag = true;
							flag2 = true;
							index = i;
							break;
						}
					}
				}
				if (!flag2)
				{
					this.AppendParticles(b.GetChild(i), count, boneLength);
				}
			}
			if (flag)
			{
				for (int l = 0; l < b.GetChild(index).childCount; l++)
				{
					bool flag3 = false;
					for (int m = 0; m < this.m_Exclusions.Count; m++)
					{
						Transform x3 = this.m_Exclusions[m];
						if (x3 == b.GetChild(index).GetChild(l))
						{
							flag3 = true;
							break;
						}
					}
					if (!flag3)
					{
						for (int n = 0; n < this.m_notRolls.Count; n++)
						{
							Transform x4 = this.m_notRolls[n];
							if (x4 == b.GetChild(index).GetChild(l))
							{
								flag3 = true;
								break;
							}
						}
					}
					if (!flag3)
					{
						this.AppendParticles(b.GetChild(index).GetChild(l), count, boneLength);
					}
				}
			}
			if (b.childCount == 0 && (this.m_EndLength > 0f || this.m_EndOffset != Vector3.zero))
			{
				this.AppendParticles(null, count, boneLength);
			}
		}
	}

	// Token: 0x06000012 RID: 18 RVA: 0x00002CF4 File Offset: 0x00000EF4
	public virtual void InitTransforms()
	{
		for (int i = 0; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			if (particle.m_Transform != null)
			{
				particle.m_Transform.localPosition = particle.m_InitLocalPosition;
				particle.m_Transform.localRotation = particle.m_InitLocalRotation;
			}
		}
	}

	// Token: 0x06000013 RID: 19 RVA: 0x00002D60 File Offset: 0x00000F60
	public virtual void ResetParticlesPosition()
	{
		for (int i = 0; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			if (particle.m_Transform != null)
			{
				particle.m_Position = (particle.m_PrevPosition = particle.m_Transform.position);
			}
			else
			{
				Transform transform = this.m_Particles[particle.m_ParentIndex].m_Transform;
				particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset));
			}
		}
		this.m_ObjectPrevPosition = base.transform.position;
	}

	// Token: 0x06000014 RID: 20 RVA: 0x00002E0C File Offset: 0x0000100C
	public virtual void UpdateParticles1()
	{
		Vector3 vector = this.m_Gravity;
		Vector3 normalized = this.m_Gravity.normalized;
		Vector3 lhs = this.m_Root.TransformDirection(this.m_LocalGravity);
		Vector3 b = normalized * Mathf.Max(Vector3.Dot(lhs, normalized), 0f);
		vector -= b;
		vector = (vector + this.m_Force) * this.m_ObjectScale;
		for (int i = 0; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			if (particle.m_ParentIndex >= 0)
			{
				Vector3 a = particle.m_Position - particle.m_PrevPosition;
				Vector3 b2 = this.m_ObjectMove * particle.m_Inert;
				particle.m_PrevPosition = particle.m_Position + b2;
				particle.m_Position += a * (1f - particle.m_Damping) + vector + b2;
			}
			else
			{
				particle.m_PrevPosition = particle.m_Position;
				particle.m_Position = particle.m_Transform.position;
			}
		}
	}

	// Token: 0x06000015 RID: 21 RVA: 0x00002F4C File Offset: 0x0000114C
	public virtual void UpdateParticles2()
	{
		Plane plane = default(Plane);
		for (int i = 1; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			global::DynamicBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
			float magnitude;
			if (particle.m_Transform != null)
			{
				magnitude = (particle2.m_Transform.position - particle.m_Transform.position).magnitude;
			}
			else
			{
				magnitude = particle2.m_Transform.localToWorldMatrix.MultiplyVector(particle.m_EndOffset).magnitude;
			}
			float num = Mathf.Lerp(1f, particle.m_Stiffness, this.m_Weight);
			if (num > 0f || particle.m_Elasticity > 0f)
			{
				Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix;
				localToWorldMatrix.SetColumn(3, particle2.m_Position);
				Vector3 a;
				if (particle.m_Transform != null)
				{
					a = localToWorldMatrix.MultiplyPoint3x4(particle.m_Transform.localPosition);
				}
				else
				{
					a = localToWorldMatrix.MultiplyPoint3x4(particle.m_EndOffset);
				}
				Vector3 a2 = a - particle.m_Position;
				particle.m_Position += a2 * particle.m_Elasticity;
				if (num > 0f)
				{
					a2 = a - particle.m_Position;
					float magnitude2 = a2.magnitude;
					float num2 = magnitude * (1f - num) * 2f;
					if (magnitude2 > num2)
					{
						particle.m_Position += a2 * ((magnitude2 - num2) / magnitude2);
					}
				}
			}
			if (this.m_Colliders != null)
			{
				float particleRadius = particle.m_Radius * this.m_ObjectScale;
				for (int j = 0; j < this.m_Colliders.Count; j++)
				{
					global::DynamicBoneCollider dynamicBoneCollider = this.m_Colliders[j];
					if (dynamicBoneCollider != null && dynamicBoneCollider.enabled)
					{
						dynamicBoneCollider.Collide(ref particle.m_Position, particleRadius);
					}
				}
			}
			if (this.m_FreezeAxis != global::DynamicBone.FreezeAxis.None)
			{
				switch (this.m_FreezeAxis)
				{
				case global::DynamicBone.FreezeAxis.X:
					plane.SetNormalAndPosition(particle2.m_Transform.right, particle2.m_Position);
					break;
				case global::DynamicBone.FreezeAxis.Y:
					plane.SetNormalAndPosition(particle2.m_Transform.up, particle2.m_Position);
					break;
				case global::DynamicBone.FreezeAxis.Z:
					plane.SetNormalAndPosition(particle2.m_Transform.forward, particle2.m_Position);
					break;
				}
				particle.m_Position -= plane.normal * plane.GetDistanceToPoint(particle.m_Position);
			}
			Vector3 a3 = particle2.m_Position - particle.m_Position;
			float magnitude3 = a3.magnitude;
			if (magnitude3 > 0f)
			{
				particle.m_Position += a3 * ((magnitude3 - magnitude) / magnitude3);
			}
		}
	}

	// Token: 0x06000016 RID: 22 RVA: 0x00003280 File Offset: 0x00001480
	public virtual void SkipUpdateParticles()
	{
		for (int i = 0; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			if (particle.m_ParentIndex >= 0)
			{
				particle.m_PrevPosition += this.m_ObjectMove;
				particle.m_Position += this.m_ObjectMove;
				global::DynamicBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
				float magnitude;
				if (particle.m_Transform != null)
				{
					magnitude = (particle2.m_Transform.position - particle.m_Transform.position).magnitude;
				}
				else
				{
					magnitude = particle2.m_Transform.localToWorldMatrix.MultiplyVector(particle.m_EndOffset).magnitude;
				}
				float num = Mathf.Lerp(1f, particle.m_Stiffness, this.m_Weight);
				if (num > 0f)
				{
					Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix;
					localToWorldMatrix.SetColumn(3, particle2.m_Position);
					Vector3 a;
					if (particle.m_Transform != null)
					{
						a = localToWorldMatrix.MultiplyPoint3x4(particle.m_Transform.localPosition);
					}
					else
					{
						a = localToWorldMatrix.MultiplyPoint3x4(particle.m_EndOffset);
					}
					Vector3 a2 = a - particle.m_Position;
					float magnitude2 = a2.magnitude;
					float num2 = magnitude * (1f - num) * 2f;
					if (magnitude2 > num2)
					{
						particle.m_Position += a2 * ((magnitude2 - num2) / magnitude2);
					}
				}
				Vector3 a3 = particle2.m_Position - particle.m_Position;
				float magnitude3 = a3.magnitude;
				if (magnitude3 > 0f)
				{
					particle.m_Position += a3 * ((magnitude3 - magnitude) / magnitude3);
				}
			}
			else
			{
				particle.m_PrevPosition = particle.m_Position;
				particle.m_Position = particle.m_Transform.position;
			}
		}
	}

	// Token: 0x06000017 RID: 23 RVA: 0x0000349C File Offset: 0x0000169C
	public virtual Vector3 MirrorVector(Vector3 v, Vector3 axis)
	{
		return v - axis * (Vector3.Dot(v, axis) * 2f);
	}

	// Token: 0x06000018 RID: 24 RVA: 0x000034B8 File Offset: 0x000016B8
	public virtual void ApplyParticlesToTransforms()
	{
		Vector3 right = Vector3.right;
		Vector3 up = Vector3.up;
		Vector3 forward = Vector3.forward;
		Vector3 localScale = base.transform.localScale;
		bool flag = localScale.x < 0f;
		if (flag)
		{
			right = base.transform.right;
		}
		bool flag2 = localScale.y < 0f;
		if (flag2)
		{
			up = base.transform.up;
		}
		bool flag3 = localScale.z < 0f;
		if (flag3)
		{
			forward = base.transform.forward;
		}
		Transform parent = base.transform.parent;
		if (parent != null)
		{
			localScale = parent.localScale;
			if (!flag && localScale.x < 0f)
			{
				flag = true;
				right = parent.right;
			}
			if (!flag2 && localScale.y < 0f)
			{
				flag2 = true;
				up = parent.up;
			}
			if (!flag3 && localScale.z < 0f)
			{
				flag3 = true;
				forward = parent.forward;
			}
		}
		for (int i = 1; i < this.m_Particles.Count; i++)
		{
			global::DynamicBone.Particle particle = this.m_Particles[i];
			global::DynamicBone.Particle particle2 = this.m_Particles[particle.m_ParentIndex];
			if (particle2.m_Transform.childCount <= 1)
			{
				Vector3 direction;
				if (particle.m_Transform != null)
				{
					direction = particle.m_Transform.localPosition;
				}
				else
				{
					direction = particle.m_EndOffset;
				}
				Vector3 vector = particle.m_Position - particle2.m_Position;
				if (flag)
				{
					vector = this.MirrorVector(vector, right);
				}
				if (flag2)
				{
					vector = this.MirrorVector(vector, up);
				}
				if (flag3)
				{
					vector = this.MirrorVector(vector, forward);
				}
				Quaternion lhs = Quaternion.FromToRotation(particle2.m_Transform.TransformDirection(direction), vector);
				particle2.m_Transform.rotation = lhs * particle2.m_Transform.rotation;
			}
			if (particle.m_Transform != null)
			{
				particle.m_Transform.position = particle.m_Position;
			}
		}
	}

	// Token: 0x04000002 RID: 2
	public Transform m_Root;

	// Token: 0x04000003 RID: 3
	public float m_UpdateRate = 60f;

	// Token: 0x04000004 RID: 4
	[Range(0f, 1f)]
	public float m_Damping = 0.1f;

	// Token: 0x04000005 RID: 5
	public AnimationCurve m_DampingDistrib;

	// Token: 0x04000006 RID: 6
	[Range(0f, 1f)]
	public float m_Elasticity = 0.1f;

	// Token: 0x04000007 RID: 7
	public AnimationCurve m_ElasticityDistrib;

	// Token: 0x04000008 RID: 8
	[Range(0f, 1f)]
	public float m_Stiffness = 0.1f;

	// Token: 0x04000009 RID: 9
	public AnimationCurve m_StiffnessDistrib;

	// Token: 0x0400000A RID: 10
	[Range(0f, 1f)]
	public float m_Inert;

	// Token: 0x0400000B RID: 11
	public AnimationCurve m_InertDistrib;

	// Token: 0x0400000C RID: 12
	public float m_Radius;

	// Token: 0x0400000D RID: 13
	public AnimationCurve m_RadiusDistrib;

	// Token: 0x0400000E RID: 14
	public float m_EndLength;

	// Token: 0x0400000F RID: 15
	public Vector3 m_EndOffset = Vector3.zero;

	// Token: 0x04000010 RID: 16
	public Vector3 m_Gravity = Vector3.zero;

	// Token: 0x04000011 RID: 17
	public Vector3 m_Force = Vector3.zero;

	// Token: 0x04000012 RID: 18
	public List<global::DynamicBoneCollider> m_Colliders;

	// Token: 0x04000013 RID: 19
	public List<Transform> m_Exclusions;

	// Token: 0x04000014 RID: 20
	public global::DynamicBone.FreezeAxis m_FreezeAxis;

	// Token: 0x04000015 RID: 21
	public bool m_DistantDisable;

	// Token: 0x04000016 RID: 22
	public Transform m_ReferenceObject;

	// Token: 0x04000017 RID: 23
	public float m_DistanceToObject = 20f;

	// Token: 0x04000018 RID: 24
	public List<Transform> m_notRolls;

	// Token: 0x04000019 RID: 25
	protected Vector3 m_LocalGravity = Vector3.zero;

	// Token: 0x0400001A RID: 26
	protected Vector3 m_ObjectMove = Vector3.zero;

	// Token: 0x0400001B RID: 27
	protected Vector3 m_ObjectPrevPosition = Vector3.zero;

	// Token: 0x0400001C RID: 28
	protected float m_BoneTotalLength;

	// Token: 0x0400001D RID: 29
	protected float m_ObjectScale = 1f;

	// Token: 0x0400001E RID: 30
	protected float m_Time;

	// Token: 0x0400001F RID: 31
	protected float m_Weight = 1f;

	// Token: 0x04000020 RID: 32
	protected bool m_DistantDisabled;

	// Token: 0x04000021 RID: 33
	protected List<global::DynamicBone.Particle> m_Particles = new List<global::DynamicBone.Particle>();

	// Token: 0x02000004 RID: 4
	public enum FreezeAxis
	{
		// Token: 0x04000023 RID: 35
		None,
		// Token: 0x04000024 RID: 36
		X,
		// Token: 0x04000025 RID: 37
		Y,
		// Token: 0x04000026 RID: 38
		Z
	}

	// Token: 0x02000005 RID: 5
	public class Particle
	{
		// Token: 0x04000027 RID: 39
		public Transform m_Transform;

		// Token: 0x04000028 RID: 40
		public int m_ParentIndex = -1;

		// Token: 0x04000029 RID: 41
		public float m_Damping;

		// Token: 0x0400002A RID: 42
		public float m_Elasticity;

		// Token: 0x0400002B RID: 43
		public float m_Stiffness;

		// Token: 0x0400002C RID: 44
		public float m_Inert;

		// Token: 0x0400002D RID: 45
		public float m_Radius;

		// Token: 0x0400002E RID: 46
		public float m_BoneLength;

		// Token: 0x0400002F RID: 47
		public Vector3 m_Position = Vector3.zero;

		// Token: 0x04000030 RID: 48
		public Vector3 m_PrevPosition = Vector3.zero;

		// Token: 0x04000031 RID: 49
		public Vector3 m_EndOffset = Vector3.zero;

		// Token: 0x04000032 RID: 50
		public Vector3 m_InitLocalPosition = Vector3.zero;

		// Token: 0x04000033 RID: 51
		public Quaternion m_InitLocalRotation = Quaternion.identity;
	}
}
